﻿#ifndef CUSTOM_COMMON_INCLUDED
#define CUSTOM_COMMON_INCLUDED

//Core RP包含许多 别名/宏指令
#include "Library\PackageCache\com.unity.render-pipelines.core@7.3.1\ShaderLibrary\Common.hlsl"
//Core RP包含BRDF粗糙度转光滑度的API
#include "Library\PackageCache\com.unity.render-pipelines.core@7.3.1\ShaderLibrary\CommonMaterial.hlsl"
//Unity 传入的
#include "UnityInput.hlsl"

#define UNITY_MATRIX_M unity_ObjectToWorld
#define UNITY_MATRIX_I_M unity_WorldToObject
#define UNITY_MATRIX_V unity_MatrixV
#define UNITY_MATRIX_VP unity_MatrixVP
#define UNITY_MATRIX_P glstate_matrix_projection

//Core RP包含的 GPU Instance
#include "Library\PackageCache\com.unity.render-pipelines.core@7.3.1\ShaderLibrary\UnityInstancing.hlsl"
//Core RP包含的 各类空间变换API
#include "Library\PackageCache\com.unity.render-pipelines.core@7.3.1\ShaderLibrary\SpaceTransforms.hlsl"

// //模型空间转换到世界空间
// float3 TransformObjectToWorld(float3 positionOS)
// {
//     return mul(unity_ObjectToWorld,float4(positionOS,1.0)).xyz;
// }
// //世界空间转换到齐次裁剪空间
// float4 TransformWorldToHClip(float3 positionWS)
// {
//     return mul(unity_MatrixVP,float4(positionWS,1.0));
// }

//平方计算
float Square(float v)
{
    return v*v;
}

#endif